import { Component } from '@angular/core';

import { LiveHistoryService } from './live.history.service';

import { LiveBase } from '../live.base';

import { Util } from '../../../utils/util';

@Component({
  selector: 'live-history',
  templateUrl: './live.history.html',
  styles: [`
  .darenLogo {
    display: inline-block;
  }

  .darenLogo img {
    border-radius: 50%;
    border: 1px solid #ccc;
  }
  `],
  providers: [LiveHistoryService]
})

export class LiveHistoryComponent extends LiveBase {

  liver: any;

  constructor(public service: LiveHistoryService, private util: Util) {

    super(service);

    this.liver = this.util.sessionStore().get('liveDetail');

    this.param.darenId = this.liver.darenId;

    this.getHttp(this.param);
  }

  getHttp(param) {

    var res = {"code":0,"msg":"成功","data":[{"darenId":263817957,"name":null,"logo":null,"fansNum":15461459,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":30.19,"sellAmount7Days":1118.0,"sellMoney7Days":33756.0,"price30Days":98.37,"sellAmount30Days":5433,"sellMoney30Days":534449.0,"date":"2017-11-04 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15509662,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":30.02,"sellAmount7Days":1165.0,"sellMoney7Days":34976.0,"price30Days":97.75,"sellAmount30Days":5480,"sellMoney30Days":535669.0,"date":"2017-11-05 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15509662,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":30.02,"sellAmount7Days":1165.0,"sellMoney7Days":34976.0,"price30Days":97.75,"sellAmount30Days":5480,"sellMoney30Days":535669.0,"date":"2017-11-06 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15509662,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":57.7,"sellAmount7Days":281.0,"sellMoney7Days":16214.0,"price30Days":97.75,"sellAmount30Days":5480,"sellMoney30Days":535669.0,"date":"2017-11-07 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15509662,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":25.96,"sellAmount7Days":47.0,"sellMoney7Days":1220.0,"price30Days":97.75,"sellAmount30Days":5480,"sellMoney30Days":535669.0,"date":"2017-11-09 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15752797,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":297.23,"sellAmount7Days":23216.0,"sellMoney7Days":6900509.0,"price30Days":259.73,"sellAmount30Days":28356,"sellMoney30Days":7364922.0,"date":"2017-11-11 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15752797,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":297.23,"sellAmount7Days":23216.0,"sellMoney7Days":6900509.0,"price30Days":259.92,"sellAmount30Days":28063,"sellMoney30Days":7294217.0,"date":"2017-11-12 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15831113,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":297.23,"sellAmount7Days":23216.0,"sellMoney7Days":6900509.0,"price30Days":264.06,"sellAmount30Days":26456,"sellMoney30Days":6986087.0,"date":"2017-11-16 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15831113,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":297.23,"sellAmount7Days":23216.0,"sellMoney7Days":6900509.0,"price30Days":264.06,"sellAmount30Days":26456,"sellMoney30Days":6986087.0,"date":"2017-11-17 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15831113,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":298.25,"sellAmount7Days":23119.0,"sellMoney7Days":6895157.0,"price30Days":264.06,"sellAmount30Days":26456,"sellMoney30Days":6986087.0,"date":"2017-11-18 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15831113,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":0.0,"sellAmount7Days":0.0,"sellMoney7Days":0.0,"price30Days":264.06,"sellAmount30Days":26456,"sellMoney30Days":6986087.0,"date":"2017-11-19 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15831113,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":0.0,"sellAmount7Days":0.0,"sellMoney7Days":0.0,"price30Days":264.06,"sellAmount30Days":26456,"sellMoney30Days":6986087.0,"date":"2017-11-20 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15831113,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":0.0,"sellAmount7Days":0.0,"sellMoney7Days":0.0,"price30Days":264.06,"sellAmount30Days":26456,"sellMoney30Days":6986087.0,"date":"2017-11-21 00:00:00"},{"darenId":263817957,"name":null,"logo":null,"fansNum":15831113,"area":"女装/男装/内衣--女装/女士精品","uid":null,"sid":null,"wangwangLink":null,"modifyTime":null,"price7Days":0.0,"sellAmount7Days":0.0,"sellMoney7Days":0.0,"price30Days":264.06,"sellAmount30Days":26456,"sellMoney30Days":6986087.0,"date":"2017-11-22 00:00:00"}]};

    setTimeout(() => {

      this.vm.table.livers = res.data;

      this.vm.table.count = res.data.length;

    }, 100);
  }



}
